Overview

The goal of this markdown is to see where in the Klamath basin, and what type of data is available from the WQX portal. The available databases on WQX are NWIS (USGS) and WQX(EPA). WQX is a data warehouse for water quality, biological, and physical data used by state environmental agencies, the EPA, other federal agencies, universities, private citizens, and others.

We are using two dataRetrival functions, whatWQPsites and readWQPdata

Detailed information about fields metadata can be found here

whatWQPsites

The following function returns sites that have collected data in the Klamath Basin. Below, is an overview of the column names of the data request are shown.

  • column names of site/station information
##  [1] "OrganizationIdentifier"                         
##  [2] "OrganizationFormalName"                         
##  [3] "MonitoringLocationIdentifier"                   
##  [4] "MonitoringLocationName"                         
##  [5] "MonitoringLocationTypeName"                     
##  [6] "MonitoringLocationDescriptionText"              
##  [7] "HUCEightDigitCode"                              
##  [8] "DrainageAreaMeasure.MeasureValue"               
##  [9] "DrainageAreaMeasure.MeasureUnitCode"            
## [10] "ContributingDrainageAreaMeasure.MeasureValue"   
## [11] "ContributingDrainageAreaMeasure.MeasureUnitCode"
## [12] "LatitudeMeasure"                                
## [13] "LongitudeMeasure"                               
## [14] "SourceMapScaleNumeric"                          
## [15] "HorizontalAccuracyMeasure.MeasureValue"         
## [16] "HorizontalAccuracyMeasure.MeasureUnitCode"      
## [17] "HorizontalCollectionMethodName"                 
## [18] "HorizontalCoordinateReferenceSystemDatumName"   
## [19] "VerticalMeasure.MeasureValue"                   
## [20] "VerticalMeasure.MeasureUnitCode"                
## [21] "VerticalAccuracyMeasure.MeasureValue"           
## [22] "VerticalAccuracyMeasure.MeasureUnitCode"        
## [23] "VerticalCollectionMethodName"                   
## [24] "VerticalCoordinateReferenceSystemDatumName"     
## [25] "CountryCode"                                    
## [26] "StateCode"                                      
## [27] "CountyCode"                                     
## [28] "AquiferName"                                    
## [29] "LocalAqfrName"                                  
## [30] "FormationTypeText"                              
## [31] "AquiferTypeName"                                
## [32] "ConstructionDateText"                           
## [33] "WellDepthMeasure.MeasureValue"                  
## [34] "WellDepthMeasure.MeasureUnitCode"               
## [35] "WellHoleDepthMeasure.MeasureValue"              
## [36] "WellHoleDepthMeasure.MeasureUnitCode"           
## [37] "ProviderName"

readWQPdata

Imports data from Water Quality Portal web service.

  • List of column names:
##  [1] "OrganizationIdentifier"                           
##  [2] "OrganizationFormalName"                           
##  [3] "ActivityIdentifier"                               
##  [4] "ActivityTypeCode"                                 
##  [5] "ActivityMediaName"                                
##  [6] "ActivityMediaSubdivisionName"                     
##  [7] "ActivityStartDate"                                
##  [8] "ActivityStartTime.Time"                           
##  [9] "ActivityStartTime.TimeZoneCode"                   
## [10] "ActivityEndDate"                                  
## [11] "ActivityEndTime.Time"                             
## [12] "ActivityEndTime.TimeZoneCode"                     
## [13] "ActivityDepthHeightMeasure.MeasureValue"          
## [14] "ActivityDepthHeightMeasure.MeasureUnitCode"       
## [15] "ActivityDepthAltitudeReferencePointText"          
## [16] "ActivityTopDepthHeightMeasure.MeasureValue"       
## [17] "ActivityTopDepthHeightMeasure.MeasureUnitCode"    
## [18] "ActivityBottomDepthHeightMeasure.MeasureValue"    
## [19] "ActivityBottomDepthHeightMeasure.MeasureUnitCode" 
## [20] "ProjectIdentifier"                                
## [21] "ActivityConductingOrganizationText"               
## [22] "MonitoringLocationIdentifier"                     
## [23] "ActivityCommentText"                              
## [24] "SampleAquifer"                                    
## [25] "HydrologicCondition"                              
## [26] "HydrologicEvent"                                  
## [27] "SampleCollectionMethod.MethodIdentifier"          
## [28] "SampleCollectionMethod.MethodIdentifierContext"   
## [29] "SampleCollectionMethod.MethodName"                
## [30] "SampleCollectionEquipmentName"                    
## [31] "ResultDetectionConditionText"                     
## [32] "CharacteristicName"                               
## [33] "ResultSampleFractionText"                         
## [34] "ResultMeasureValue"                               
## [35] "ResultMeasure.MeasureUnitCode"                    
## [36] "MeasureQualifierCode"                             
## [37] "ResultStatusIdentifier"                           
## [38] "StatisticalBaseCode"                              
## [39] "ResultValueTypeName"                              
## [40] "ResultWeightBasisText"                            
## [41] "ResultTimeBasisText"                              
## [42] "ResultTemperatureBasisText"                       
## [43] "ResultParticleSizeBasisText"                      
## [44] "PrecisionValue"                                   
## [45] "ResultCommentText"                                
## [46] "USGSPCode"                                        
## [47] "ResultDepthHeightMeasure.MeasureValue"            
## [48] "ResultDepthHeightMeasure.MeasureUnitCode"         
## [49] "ResultDepthAltitudeReferencePointText"            
## [50] "SubjectTaxonomicName"                             
## [51] "SampleTissueAnatomyName"                          
## [52] "ResultAnalyticalMethod.MethodIdentifier"          
## [53] "ResultAnalyticalMethod.MethodIdentifierContext"   
## [54] "ResultAnalyticalMethod.MethodName"                
## [55] "MethodDescriptionText"                            
## [56] "LaboratoryName"                                   
## [57] "AnalysisStartDate"                                
## [58] "ResultLaboratoryCommentText"                      
## [59] "DetectionQuantitationLimitTypeName"               
## [60] "DetectionQuantitationLimitMeasure.MeasureValue"   
## [61] "DetectionQuantitationLimitMeasure.MeasureUnitCode"
## [62] "PreparationStartDate"                             
## [63] "ProviderName"                                     
## [64] "timeZoneStart"                                    
## [65] "timeZoneEnd"                                      
## [66] "ActivityStartDateTime"                            
## [67] "ActivityEndDateTime"

Monitoring Sites

This table shows all the monitoring sites available across the Klamath Basin

## Warning in instance$preRenderHook(instance): It seems your data is too big for
## client-side DataTables. You may consider server-side processing:
## https://rstudio.github.io/DT/server.html

Monitoring sites plot

## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set1 is 9
## Returning the palette you asked for with that many colors

## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set1 is 9
## Returning the palette you asked for with that many colors

## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set1 is 9
## Returning the palette you asked for with that many colors

Summary of sites by monitoring location type (MonitoringLocationTypeName: The descriptive name for a type of monitoring location)

Summary: Total number of records per organization

Summary: Monitoring locations with the most data

Parameters

These are the water quality parameters available (pulling 2020 - 2024 data to view parameters). Parameters of interest will be explored on separate tabs

Temperature

Glimpse of temperature data pull

## Rows: 252
## Columns: 67
## $ organization_identifier                                <chr> "OREGONDEQ", "O…
## $ organization_formal_name                               <chr> "State of Orego…
## $ activity_identifier                                    <chr> "OREGONDEQ-2405…
## $ activity_type_code                                     <chr> "Field Msr/Obs"…
## $ activity_media_name                                    <chr> "Water", "Water…
## $ activity_media_subdivision_name                        <chr> "Surface Water"…
## $ activity_start_date                                    <date> 2024-05-07, 20…
## $ activity_start_time_time                               <chr> "14:44:00", "13…
## $ activity_start_time_time_zone_code                     <chr> "PST", "PST", "…
## $ activity_end_date                                      <date> 2024-05-07, 20…
## $ activity_end_time_time                                 <chr> "14:44:00", "13…
## $ activity_end_time_time_zone_code                       <chr> "PST", "PST", "…
## $ activity_depth_height_measure_measure_value            <dbl> NA, NA, NA, NA,…
## $ activity_depth_height_measure_measure_unit_code        <chr> NA, NA, NA, NA,…
## $ activity_depth_altitude_reference_point_text           <chr> NA, NA, NA, NA,…
## $ activity_top_depth_height_measure_measure_value        <dbl> NA, NA, NA, NA,…
## $ activity_top_depth_height_measure_measure_unit_code    <chr> NA, NA, NA, NA,…
## $ activity_bottom_depth_height_measure_measure_value     <dbl> NA, NA, NA, NA,…
## $ activity_bottom_depth_height_measure_measure_unit_code <chr> NA, NA, NA, NA,…
## $ project_identifier                                     <chr> "Surface Water …
## $ activity_conducting_organization_text                  <chr> NA, NA, NA, NA,…
## $ monitoring_location_identifier                         <chr> "OREGONDEQ-1076…
## $ activity_comment_text                                  <chr> NA, NA, NA, NA,…
## $ sample_aquifer                                         <chr> NA, NA, NA, NA,…
## $ hydrologic_condition                                   <chr> NA, NA, NA, NA,…
## $ hydrologic_event                                       <chr> NA, NA, NA, NA,…
## $ sample_collection_method_method_identifier             <chr> NA, NA, NA, NA,…
## $ sample_collection_method_method_identifier_context     <chr> NA, NA, NA, NA,…
## $ sample_collection_method_method_name                   <chr> NA, NA, NA, NA,…
## $ sample_collection_equipment_name                       <chr> NA, NA, NA, NA,…
## $ result_detection_condition_text                        <chr> NA, NA, NA, NA,…
## $ characteristic_name                                    <chr> "Temperature, w…
## $ result_sample_fraction_text                            <chr> NA, NA, NA, NA,…
## $ result_measure_value                                   <dbl> 11.1, 11.0, 19.…
## $ result_measure_measure_unit_code                       <chr> "deg C", "deg C…
## $ measure_qualifier_code                                 <chr> NA, NA, NA, NA,…
## $ result_status_identifier                               <chr> "Final", "Final…
## $ statistical_base_code                                  <chr> NA, NA, NA, NA,…
## $ result_value_type_name                                 <chr> "Actual", "Actu…
## $ result_weight_basis_text                               <chr> NA, NA, NA, NA,…
## $ result_time_basis_text                                 <chr> NA, NA, NA, NA,…
## $ result_temperature_basis_text                          <chr> NA, NA, NA, NA,…
## $ result_particle_size_basis_text                        <chr> NA, NA, NA, NA,…
## $ precision_value                                        <chr> NA, NA, NA, NA,…
## $ result_comment_text                                    <chr> NA, NA, NA, NA,…
## $ usgsp_code                                             <chr> NA, NA, NA, NA,…
## $ result_depth_height_measure_measure_value              <dbl> NA, NA, NA, NA,…
## $ result_depth_height_measure_measure_unit_code          <chr> NA, NA, NA, NA,…
## $ result_depth_altitude_reference_point_text             <chr> NA, NA, NA, NA,…
## $ subject_taxonomic_name                                 <chr> NA, NA, NA, NA,…
## $ sample_tissue_anatomy_name                             <chr> NA, NA, NA, NA,…
## $ result_analytical_method_method_identifier             <chr> "170.1", "170.1…
## $ result_analytical_method_method_identifier_context     <chr> "USEPA", "USEPA…
## $ result_analytical_method_method_name                   <chr> "Temperature", …
## $ method_description_text                                <chr> "https://www.ne…
## $ laboratory_name                                        <chr> "DEQ Laboratory…
## $ analysis_start_date                                    <date> 2024-05-07, 20…
## $ result_laboratory_comment_text                         <chr> NA, NA, NA, NA,…
## $ detection_quantitation_limit_type_name                 <chr> "Minimum Report…
## $ detection_quantitation_limit_measure_measure_value     <dbl> -10, -10, -10, …
## $ detection_quantitation_limit_measure_measure_unit_code <chr> "deg C", "deg C…
## $ preparation_start_date                                 <date> NA, NA, NA, NA…
## $ provider_name                                          <chr> "STORET", "STOR…
## $ time_zone_start                                        <dbl> 8, 8, 8, 8, 8, …
## $ time_zone_end                                          <dbl> 8, 8, 8, 8, 8, …
## $ activity_start_date_time                               <dttm> 2024-05-07 22:…
## $ activity_end_date_time                                 <dttm> 2024-05-07 22:…
#check that it is only temp data 

Glimpse of station data pull

## [1] "Temperature, water"
## Rows: 5,408
## Columns: 37
## $ organization_identifier                              <chr> "USGS-CA", "USGS-…
## $ organization_formal_name                             <chr> "USGS California …
## $ monitoring_location_identifier                       <chr> "USGS-11488495", …
## $ monitoring_location_name                             <chr> "LOST R NR HATFIE…
## $ monitoring_location_type_name                        <chr> "Stream", "Stream…
## $ monitoring_location_description_text                 <chr> NA, NA, NA, NA, N…
## $ huc_eight_digit_code                                 <chr> "18010204", "1801…
## $ drainage_area_measure_measure_value                  <dbl> NA, NA, 1.74, 9.9…
## $ drainage_area_measure_measure_unit_code              <chr> NA, NA, "sq mi", …
## $ contributing_drainage_area_measure_measure_value     <dbl> NA, NA, NA, NA, N…
## $ contributing_drainage_area_measure_measure_unit_code <chr> NA, NA, NA, NA, N…
## $ latitude_measure                                     <chr> "41.9538888900000…
## $ longitude_measure                                    <chr> "-121.50333330000…
## $ source_map_scale_numeric                             <chr> "24000", "24000",…
## $ horizontal_accuracy_measure_measure_value            <chr> "1", "1", "5", "5…
## $ horizontal_accuracy_measure_measure_unit_code        <chr> "seconds", "secon…
## $ horizontal_collection_method_name                    <chr> "Interpolated fro…
## $ horizontal_coordinate_reference_system_datum_name    <chr> "NAD83", "NAD83",…
## $ vertical_measure_measure_value                       <dbl> 4035.00, 4039.00,…
## $ vertical_measure_measure_unit_code                   <chr> "feet", "feet", N…
## $ vertical_accuracy_measure_measure_value              <dbl> 20.00, 20.00, NA,…
## $ vertical_accuracy_measure_measure_unit_code          <chr> "feet", "feet", N…
## $ vertical_collection_method_name                      <chr> "Interpolated fro…
## $ vertical_coordinate_reference_system_datum_name      <chr> "NGVD29", "NGVD29…
## $ country_code                                         <chr> "US", "US", "US",…
## $ state_code                                           <chr> "06", "06", "06",…
## $ county_code                                          <chr> "093", "093", "04…
## $ aquifer_name                                         <chr> NA, NA, NA, NA, N…
## $ local_aqfr_name                                      <chr> NA, NA, NA, NA, N…
## $ formation_type_text                                  <chr> NA, NA, NA, NA, N…
## $ aquifer_type_name                                    <chr> NA, NA, NA, NA, N…
## $ construction_date_text                               <chr> NA, NA, NA, NA, N…
## $ well_depth_measure_measure_value                     <dbl> NA, NA, NA, NA, N…
## $ well_depth_measure_measure_unit_code                 <chr> NA, NA, NA, NA, N…
## $ well_hole_depth_measure_measure_value                <dbl> NA, NA, NA, NA, N…
## $ well_hole_depth_measure_measure_unit_code            <chr> NA, NA, NA, NA, N…
## $ provider_name                                        <chr> "NWIS", "NWIS", "…

Looking how many data entries there are for each day in 2024

Plot below shows the same data than table. This indicates that data is not being collected every day

## Warning: Removed 20 rows containing missing values (`geom_col()`).

Plot below shows the amount of data entries per site, per month

Map below shows where monitoring locations are, and what agency is monitoring/mantaing it

## Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in
## dplyr 1.1.0.
## ℹ Please use `reframe()` instead.
## ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
##   always returns an ungrouped data frame and adjust accordingly.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   -0.64   13.12   16.06   16.30   19.48   73.09       8